import pandas as pd

if __name__ == '__main__':
    # df1 = pd.read_csv(r"D:\中断输入\输出\2月单用户中断明细.csv", dtype=str)
    # df2 = pd.read_csv(r"D:\Download\WeChat Files\wxid_kdchbeq2xllp22\FileStorage\File\2025-05\3月单用户中断明细.csv",
    #                   dtype=str)
    #
    # df = pd.concat([df1, df2])
    # df['日期'] = pd.to_datetime(df['日期'])
    # a = pd.Timestamp('2025-02-26')
    # b = pd.Timestamp('2025-03-25')
    # df = df[df['日期'].between(a, b)]
    #
    # g = pd.read_csv("D:\家宽\gigabitUsers.csv", dtype=str)
    # g = g[g['带宽'] == '1000M']
    # df = df[df['宽带账号'].isin(g['用户账号'])]
    # df.to_csv('/temp/0226_0325千兆中断.csv',index=False)

    df = pd.read_csv('/temp/0226_0325千兆中断.csv', dtype={"宽带账号": str, "社区归属网格": str})
    a = df['SN'].nunique()
    b = df['中断时长'].sum() / 60
    print(a)
    print(b)
    print(b / a)
